<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>
<%@ include file="/commons/nocache.jspf" %>
<%@ taglib uri="/FCKeditor" prefix="FCK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>会员管理</title>
<link href="${ctx }/css/admin/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
	color: #000000;
}
body {
	background-color: #F3F8FC;
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
a {
	font-family: 宋体;
	font-size: 12px;
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #FF3300;
}
a:active {
	color: #000000;
}
-->
#newPreview
{
    filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
}
-->
</style>
<script type="text/javascript" src="${ctx }/fckeditor/fckeditor.js"></script>
<script type="text/javascript" src="${ctx}/scripts/commons/annext.js"></script>
<script type="text/javascript" src="${ctx}/scripts/commons/jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="${ctx}/scripts/commons/jquery.MultiFile.js"></script>
<script type="text/javascript">

		function PreviewImg(imgFile){
		    //新的预览代码，支持 IE6、IE7。
		    var newPreview = document.getElementById("newPreview");
		    newPreview.filters.item("DXImageTransform.Microsoft.AlphaImageLoader").src = imgFile.value;
		    if(imgFile.value)
	  			newPreview.style.height = "71px";
			if(newPreview.innerHTML.length > 0 ){
				newPreview.innerHTML = "";
			}				
		}	
		
			function checkStr(str){
	if(str.value!=""){
	      if (!(/^[^\|"'<>:;：；‘“$%*@,.，。/、！·#￥%……—*（）——+|]*$/.test(str))){
	            setInfo("ErrorName","会员标题不能含有特殊符号");
	      		return false;
	      }
	}
	return true;
}
	        function check(){ 
	        if(checkStr(document.getElementById("productName").value)==false){
	          return false;
	        }
	           if(document.getElementById("productName").value ==""){
		          setInfo("ErrorName","会员标题不能为空");
		          return false;
			   }
	           else{
		        var valUrl = "${ctx}/product/product!check.action";
		        var parm = "product.productName="+ document.getElementById("productName").value+"&";
		        $.ajax(
			{
			type:"POST",
			url:valUrl,
			data:parm,
			dataType:"json",
			success:function(json) {
			   if(json.str == "1"){
				 setInfo("ErrorName","会员标题可以用");
				}
			  else{
				setInfo("ErrorName","会员标题已存在");
				return false;
						}
					},
					error:function(){
						setInfo("ErrorName","系统出错");
					}
				});
			}
     }
     
     
     function setInfo(field,info){
			document.getElementById(field).style.display = "block";
			document.getElementById(field).innerHTML = "<font color='red'>" + info + "</font>";
		}
		
		
				function showFun(){
		    var str=window.location;
			var item=window.showModalDialog("${ctx}/user/user_showFun.action?funcstr="+ str,window,"scroll:no;dialogHeight=500px;dialogWidth=420px;");
		var names ="";
        var ids ="";
	   if(item != null){
	    
	          names += item[0][0];
	          ids += item[0][1];
	      }
      	document.getElementById("funcid").value = ids;
    	document.getElementById("funcname").value = names;
		}
</script>

</head>
<link href="${ctx}/css/main/base.css" rel="stylesheet" type="text/css"/>
<link href="${ctx}/css/main/main.css" rel="stylesheet" type="text/css"/>
<body>
<div id="main">
	<div class="zdsz" id="select1">
		<div class="tab"><a href="ctx/../product!index.action"><h3 class="sel" >添加会员</h3></a><a href="ctx/../product!listProduct.action"><h3>会员列表</h3></a></div>
		<div class="zd_gut">
		<ul class="block">
		<li>
<form name="form1" action="${ctx}/product/product!create.action" method="post"  enctype="multipart/form-data" >
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="${ctx }/images/maintopbg.gif">
  <tr>
    <td align="left"><img src="${ctx }/images/maintop.gif" width="7" height="12" /></td>
  </tr>
</table>

<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<input type="hidden" name="product.productTop" value="1"/>
  <tr>
    <td   height="30" align="right" bgcolor="#DFEAF3">功能分类：</td>
     <td height="30"  align="left" bgcolor="#FFFFFF" class="tblz5">
      <input type="hidden" id="funcid" name="product.funcId" />
    	<input type="input" id="funcname" readonly name="funcnames" onclick="showFun();"/>
    </td>
    <td height="25" align="right" bgcolor="#DFEAF3">是否发布：</td>
    <td height="25" align="left" bgcolor="#FFFFFF" class="tblz5">
    <input type="radio" name="product.productFlag" value="0" checked />是
    <input type="radio" name="product.productFlag" value="1" />否
    </td>
  </tr>

  <tr>
    <td height="30" align="right" bgcolor="#DFEAF3">会员名称：</td>
    <td height="30" align="left" bgcolor="#FFFFFF" class="tblz5" colspan="3">
    <input id="productName" name="product.productName" type="text" class="fl_l" maxlength="100" />
    <div id="ErrorName" class="fielderror"></div></td>
  </tr>
   
  <tr>
  
    <td height="25" width="20%" align="right" bgcolor="#DFEAF3">会员图片：</td>
    <td height="25"  width="30%" align="left" bgcolor="#FFFFFF" class="tblz5">
    <input id="file" type="file" name="productPhoto" id="productPhoto"  class="input01" onchange="javascript:PreviewImg(this);"/>
    </td>
    <td height="30" align="right" bgcolor="#DFEAF3">图片信息：</td>
    <td height="30" align="left" bgcolor="#FFFFFF" class="tblz5">
        <div id="newPreview" style="width: 223px;height: 71px;vertical-align: middle;border: 0px solid red;vertical-align: middle;">
			<img id="view" src="" width="223" height="71" class="videoimg" />
		</div>
   <tr>
    <td height="30" align="right" bgcolor="#DFEAF3">会员简介：</td>
    <td height="30" colspan="3" align="left" bgcolor="#FFFFFF" class="tblz5">
    <FCK:editor id="product.productContent" basePath="${ctx}/fckeditor/" width="100%" height="300px" skinPath="${ctx}/fckeditor/editor/skins/office2003/"  toolbarSet="Default">
	</FCK:editor>
    	</td>
  </tr>

 
<table height="50" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="150" align="right"><input type="submit" value="提交" class="btn"/></td>
    <td width="100" align="right"><input type="reset" value="重置" class="btn"/></td>
  </tr>
</table>
</from>
	</li>
		</ul>
		</div>
	</div>
</div>
</body>
</html>

